#!/usr/bin/python3.5
# -*- coding utf-8

import time
import requests

# 笔趣阁书籍爬虫
session = requests.Session()
header = {
    'Cookie': '_abcde_qweasd=0; bdshare_firstime=1566437197597; size=12pt; '
              'BAIDU_SSP_lcr=https://www.baidu.com/link?url=XhpTd7jynXWOsvo8aEGpJZ7dBs9jmOluuufSgsLypQi&wd=&eqid'
              '=b6b45bca002878b4000000065dc2c670; _abcde_qweasd=0; '
              'Hm_lvt_169609146ffe5972484b0957bd1b46d6=1573045879; '
              'Hm_lpvt_169609146ffe5972484b0957bd1b46d6=1573047439',
    'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) '
                  'Chrome/78.0.3904.87 Safari/537.36 '
}

content = requests.get(url="http://www.xbiquge.la/10/10489/9688143.html", headers=header).content.decode("utf-8")
content = content.strip()
time.sleep(5)
print('初始content', content)
start = content.find('<div class="nav">')
end = content.find("</div>")
content = content[start:end + len('</div>')].strip()
print('==============================================================')
print('content', content)
